<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/share/taglib.jsp"%>
<script type="text/javascript">
<!--
	function buttonToPage(totalPage) {
		var pagenum = document.getElementById("pagenum").value;
		if(pagenum == null || pagenum == "") {
			alert("请填写请求的页码");
			return false;
		}
		if(pagenum > totalPage*1) {
			pagenum = totalPage*1;
		} else if(pagenum < 1) {
			pagenum = 1;
		}
		topage(pagenum);
	}
	
/*
function topage(currentPage, isAjax) {
	//如果不是ajax请求的分页,则正常提交表单
	if(isAjax != null && isAjax != "") {
		$("#currentPage").val(currentPage);
		//如果是ajax请求的分页，则进行ajax提交表单
		var path = $("#form").attr("action");
		$.ajax({
			url : path,
			data : $("#form").serialize(),
			type : "post",
			success : function(data) {
				$("#abc").html(data);
			}
		});
	} else {
		$("#currentPage").val(currentPage);
		$("#form").submit();
	}
}*/
//-->
</script>

<c:if test="${pageView.qr.totalRecords > 0 }">
	<td height="3">
		<img src="${base }/images/spacer.gif" width="1" height="1" /> 
		<input type="hidden" name="page" id="currentPage"/>
	</td>
	<td height="33" align="left">
		共<span class="right-text09">${pageView.totalPage }</span>页 | 
		共<span class="right-text09">${pageView.qr.totalRecords }</span>条记录 
		<c:if test="${pageView.qr.totalRecords != 0 }">
			 | 每页显示<span class="right-text09">${pageView.maxResult }</span>条 | 
			 当前第<span class="right-text09">${pageView.currentPage }</span>页 |
		</c:if>
	</td>
	<td align="right">
		<c:if test="${pageView.totalPage != 0 }">
			<c:if test="${pageView.currentPage != 1 }">
				[<a href="javascript:topage('1', '${isAjax }');" class="right-font08">首页</a>] | 
				[<a href="javascript:topage('${pageView.currentPage -1 }', '${isAjax }');" class="right-font08">上一页</a>]&nbsp;
			</c:if>
			<c:forEach begin="${pageView.pageIndex.start }" end="${pageView.pageIndex.end }" var="sp">
				<c:if test="${sp != pageView.currentPage }">
					<a href="javascript:topage('${sp }', '${isAjax }');"> ${sp } </a>&nbsp;
				</c:if>
				<c:if test="${sp == pageView.currentPage }">
					<font color="red" style="font:bold;"> ${sp } </font>&nbsp;
				</c:if>
			</c:forEach>
			<c:if test="${pageView.currentPage != pageView.totalPage }">
				[<a href="javascript:topage('${pageView.currentPage +1 }', '${isAjax }');" class="right-font08">下一页</a>] | 
				[<a href="javascript:topage('${pageView.totalPage}', '${isAjax }');" class="right-font08">末页</a>]&nbsp;&nbsp;&nbsp;
			</c:if>
		</c:if>
	</td>
</c:if>
